# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AppEngine.V1.Model.OperationMetadataV1 do
  @moduledoc """
  Metadata for the given google.longrunning.Operation.

  ## Attributes

  *   `createVersionMetadata` (*type:* `GoogleApi.AppEngine.V1.Model.CreateVersionMetadataV1.t`, *default:* `nil`) - 
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Time that this operation completed.@OutputOnly
  *   `ephemeralMessage` (*type:* `String.t`, *default:* `nil`) - Ephemeral message that may change every time the operation is polled. @OutputOnly
  *   `insertTime` (*type:* `DateTime.t`, *default:* `nil`) - Time that this operation was created.@OutputOnly
  *   `method` (*type:* `String.t`, *default:* `nil`) - API method that initiated this operation. Example: google.appengine.v1.Versions.CreateVersion.@OutputOnly
  *   `target` (*type:* `String.t`, *default:* `nil`) - Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly
  *   `user` (*type:* `String.t`, *default:* `nil`) - User who requested this operation.@OutputOnly
  *   `warning` (*type:* `list(String.t)`, *default:* `nil`) - Durable messages that persist on every operation poll. @OutputOnly
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createVersionMetadata =>
            GoogleApi.AppEngine.V1.Model.CreateVersionMetadataV1.t() | nil,
          :endTime => DateTime.t() | nil,
          :ephemeralMessage => String.t() | nil,
          :insertTime => DateTime.t() | nil,
          :method => String.t() | nil,
          :target => String.t() | nil,
          :user => String.t() | nil,
          :warning => list(String.t()) | nil
        }

  field(:createVersionMetadata, as: GoogleApi.AppEngine.V1.Model.CreateVersionMetadataV1)
  field(:endTime, as: DateTime)
  field(:ephemeralMessage)
  field(:insertTime, as: DateTime)
  field(:method)
  field(:target)
  field(:user)
  field(:warning, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.AppEngine.V1.Model.OperationMetadataV1 do
  def decode(value, options) do
    GoogleApi.AppEngine.V1.Model.OperationMetadataV1.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AppEngine.V1.Model.OperationMetadataV1 do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
